#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<stdlib.h>
typedef struct BinTreeNode
{
	char val;
	struct BinTreeNode* left;
	struct BinTreeNode* right;
}BTNode;
BTNode* CreateTree(char* a, int* i)
{
	if (a[(*i)] == NULL)
	{
		(*i)++;
		return NULL;
	}
	BTNode* root = (BTNode*)malloc(sizeof(BTNode));
	root->val = a[(*i)++];
	root->left = CreateTree(a, i);
	root ->right = CreateTree(a, i);
	return root;
}
void InOrder(BTNode* root)
{
	if (root == NULL)
		return;
	InOrder(root->left);
	printf("%c", root->val);
	InOrder(root->right);
}
int main()
{
	char a[100];
	scanf("%c", a);
	int i = 0;
	BTNode* root = CreateTree(a, &i);
	InOrder(root);
	return 0;
}